import { E_ItemType } from "../defs/item/E_ItemType";
import { CEHandBook } from "../excel_extend/CEHandBook";
import { Equip } from "../struct/Equip";
import { Player } from "../struct/Player";
import { SDEquip } from "./SDEquip";




/**
 * 数据-图鉴
 */
export abstract class SDHandBook {


    /**
     * 获取可能生成
     * @param player 
     * @param configId 
     * @returns 
     */
    public static getPossibleHandBookEquip(player: Player, configId: number): Equip {
        const lv = SDEquip.getEquipLevelMax(player);
        const equip = SDEquip.createNew(null, configId, lv);
        return equip;
    }


    /**
     * 是否在图鉴中
     * @param itemType 
     * @param itemId 
     * @returns 
     */
    public static isInHandBook(itemType: E_ItemType, itemId: number): boolean {
        const config = CEHandBook.getItemBookConfig(itemType, itemId);
        return config !== null;
    }


    /**
     * 检测获得
     * @param player 
     * @param itemType 
     * @param itemId 
     */
    public static checkId(
        player: Player,
        itemType: E_ItemType,
        itemId: number
    ): void {
        if (!player) {
            return;
        }
    }


}
